#include<stdio.h>
#include<stdlib.h>
void Task1();
void Task2();
void Task3();

int main(){
    int x;
    scanf("%d",&x);
    switch(x){
        
        case 1:
            Task1();
            break;
        case 2:
            Task2();
            break;
        case 3:
            Task3();
            break;
    }
    return 0;
    
}

void Task1()
{
    printf("Task1:\n");
    FILE *file=fopen("dict.dic","r");
    int capital=0,lowercase=0,digit=0,others=0;
    char ch=fgetc(file);
     
    while(!feof(file)){
        
        //int i=0;
        
            if(ch>=65&&ch<=90) capital++;
            else if(ch>=97&&ch<=122) lowercase++;
            else if(ch>=48&&ch<=57) digit++;
            else others++;
        
        ch=fgetc(file);
    }
    printf("capital: %d\nlowercase: %d\ndigit: %d\nothers: %d\n",capital,lowercase,digit,others);
    fclose(file);
}
void Task2(){
    printf("Task2:\n");
    FILE *file=fopen("dict.dic","r");
    int min=0,max=0,line=0;;
    char x[500];
     fgets(x,500,file);
    while(!feof(file)){
        int count=0;
        for(int i=0;x[i]!=10;i++){
            count++;
        }
        
        if(min==0&&max==0)
        {
            min=count;
            max=count;
        }else{
            if(count>max) max=count;
            if(count<min) min=count;
        }
        line++;
        fgets(x,500,file);
    }
    
    printf("line: %d\n",line);
    printf("%d characters in max line.\n",max);
    printf("%d characters in min line.\n",min);
    fclose(file);
}
void Task3(){
    printf("Task3:\n");
    FILE *file=fopen("dict.dic","r");
    char x[500];
    int y[200]={0};
     fgets(x,500,file);
    while(!feof(file)){
        int count=0;
        for(int i=0;x[i]!=10;i++){
            y[x[i]]++;
        }
        fgets(x,500,file);
    }
    printf("CAPITAL:\n");
    for(int j=65;j<=90;j++){
        printf("%c:%d\n",j,y[j]);
    }
    printf("LOWERCASE:\n");
    for(int j=97;j<=122;j++){
        printf("%c:%d\n",j,y[j]);
    }
    fclose(file);
}